﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;

using CloudSoft.Workflows;

namespace ERPStore.NewsLetters.Workflows.Activities
{

	public sealed class SaveEmailRecipient : CodeActivity
	{
		public InArgument<ERPStore.NewsLetters.Models.EmailRecipient> EmailRecipient { get; set; }

		protected override void Execute(CodeActivityContext context)
		{
			var emailRecipient = context.GetValue(this.EmailRecipient);
			var newsLetterService = context.GetService<Services.NewsLettersService>();

			newsLetterService.SaveEmailRecipient(emailRecipient);
		}
	}
}
